import sys
import pandas as pd
import numpy as np


SERVER = '192.168.1.167'

def compress_data(filename):
    df_data = pd.read_csv(filename)

    df_data = df_data[df_data['data'].notnull()]

    # if 'hombre_' in filename:
    df_data = df_data[df_data['ip.dst'] == SERVER]
    # elif 'vm_' in filename:
        # df_data = df_data[df_data['ip.dst'] == CLIENT]


    df_data = df_data['data'].map(lambda x: x[0:16])
    df_data.to_csv('compressed_' + filename, index = None)
    return df_data


if __name__ == "__main__":
    compress_data(str(sys.argv[1]))
